import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Flutter Demo')
        ),
        //body内容多抽离出去
        body: HomeContent()
      )
    );
  }
  
}

//body
class HomeContent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return  ListView(
      padding: EdgeInsets.all(10),
      children: <Widget>[
        ListTile(
          leading: Image.network('https://www.itying.com/images/flutter/1.png'),
          title: Text('华北黄淮高温持续 南方强降雨今起强势登场'),
          subtitle: Text('中国天气网讯 21日开始，北方今年首轮大范围高温拉开序幕，昨天是高温发展的最鼎盛阶段'),
        ),
        ListTile(
          leading: Image.network('https://www.itying.com/images/flutter/2.png'),
          title: Text('华北黄淮高温持续 南方强降雨今起强势登场'),
          subtitle: Text('中国天气网讯 21日开始，北方今年首轮大范围高温拉开序幕，昨天是高温发展的最鼎盛阶段'),
        ),
        ListTile(
          leading: Image.network('https://www.itying.com/images/flutter/3.png'),
          title: Text('华北黄淮高温持续 南方强降雨今起强势登场'),
          subtitle: Text('中国天气网讯 21日开始，北方今年首轮大范围高温拉开序幕，昨天是高温发展的最鼎盛阶段'),
        ),
        ListTile(
          leading: Image.network('https://www.itying.com/images/flutter/4.png'),
          title: Text('华北黄淮高温持续 南方强降雨今起强势登场'),
          subtitle: Text('中国天气网讯 21日开始，北方今年首轮大范围高温拉开序幕，昨天是高温发展的最鼎盛阶段'),
          trailing: Image.network('https://www.itying.com/images/flutter/4.png'),
        ),
      ],
    );
  }
  
}